package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.model.ApplyModel;
import com.zr.service.CheckApplyInfoService;
/**
 * 管理员审核学生的住宿信息的调配者
 * @author 洪英杰
 *
 */
public class ShenheDormInfoController extends HttpServlet{
	CheckApplyInfoService cais=new CheckApplyInfoService();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//设置请求和响应的字符编码格式
		req.setCharacterEncoding("utf8");
		resp.setCharacterEncoding("utf8");
		//获取某个学生的学号和申请状态
		String sidStr=req.getParameter("sid");
		int sid=Integer.parseInt(sidStr);
		String astate=req.getParameter("astate");
		
		ApplyModel am=new ApplyModel();
		am.setSid(sid);
		am.setAstate(astate);
		boolean flag=cais.getDormInfo(sid,astate);
		PrintWriter pw=resp.getWriter();
		if(flag)
		{
			pw.write("审核成功!");
		}
	}
}	
